package com.zito.health.service.impl;

import com.zito.health.entity.Department;
import com.zito.health.mapper.DepartmentMapper;
import com.zito.health.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:
 * @author: Sam
 * @time: 2020/03/12 14:28
 */
@Service
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public Department save(Department object) {
        departmentMapper.insertSelective(object);
        return object;
    }

    @Override
    public void delete(Integer id) {
        departmentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void update(Department object) {
        departmentMapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public List<Department> query() {
        return null;
    }

    @Override
    public List<Department> query(Department object) {
        return departmentMapper.select(object);
    }

    @Override
    public Department queryOne(Department object) {
        return null;
    }

    @Override
    public Department queryById(Integer id) {
        Department object = departmentMapper.selectByPrimaryKey(id);
        return object;
    }

    @Override
    public boolean exists(Integer id) {
        return false;
    }
}
